/**
 * 
 */
package com.swfee.qinben.model;

import java.util.Date;

import android.content.ContentValues;

import com.swfee.qinben.util.PasswordUtils;

/**
 * 乘客信息记录表
 * 
 * @author ddr
 * 
 */
public class LastLogin implements DbModel {

	private String loginName;// 用户名
	private String password;// 密码
	private String appCode;//
	private Date loginDate;// 登录时间

	@Override
	public String toString() {
		return "[loginName=" + loginName + ",loginDate=" + loginDate + "]";
	}


	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getAppCode() {
		return appCode;
	}

	public void setAppCode(String appCode) {
		this.appCode = appCode;
	}

	public Date getLoginDate() {
		return loginDate;
	}

	public void setLoginDate(Date loginDate) {
		this.loginDate = loginDate;
	}

	@Override
	public ContentValues toCloumnCotentValues() {
		ContentValues cvs = new ContentValues();
		if (getLoginName() != null) {
			
			cvs.put("login_name", getLoginName());
		}
		if (getPassword() != null) {
			
			cvs.put("login_pwd", PasswordUtils.passToBase64Double(getPassword()));
		}
		
		if (getAppCode()!= null) {
			cvs.put("app_code", getAppCode());
		}
		if (getLoginDate() != null) {
			cvs.put("login_date", getLoginDate().getTime());
		}
		
		return cvs;
	}
}
